﻿using System.Windows;
using MinoChat.Services.Interfaces;
using MinoChat.Ui.Services;
using MinoChat.ViewModels;

namespace MinoChat.Views;

public partial class MainWindow : Window
{
    public MainWindow(MainViewModel viewModel, INavigationService navigationService, IThemeService themeService, SnackbarService snackbarService)
    {
        InitializeComponent();
        // 在窗口初始化后、显示前应用主题，确保标题栏和内容都能正确应用主题，且无闪烁
        themeService.ApplyTheme(themeService.GetCurrentThemeMode());
        // 设置承载导航内容的容器
        navigationService.SetNavigationControl(ContentContainer);
        // 注册 Snackbar
        snackbarService.RegisterSnackbar(MainSnackbar);
        DataContext = viewModel;
    }
}